package com.boang.controller;

import com.boang.domain.Spu;
import com.boang.service.SpuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
  @author: 13813
  @date: 2024/8/8 9:27
*/
@RestController
@RequestMapping("/spu")
public class SpuController {

    @Autowired
    private SpuService service;

    @RequestMapping("/getSpuList")
    public List<Spu> getSpuList() {
        return service.list();
    }

    @RequestMapping("/removeSpuById")
    public boolean removeSpuById(int spuId) {
        return service.removeById(spuId);
    }
}
